from mcp.server.fastmcp import FastMCP

# Create an MCP server
mcp = FastMCP("Greeting Server")

@mcp.tool()
def say_hello(name: str) -> str:
    """Generate a personalized greeting message"""
    return f"Hello, {name}! Welcome to our MCP service!"

@mcp.tool()
def say_goodbye(name: str) -> str:
    """Generate a personalized goodbye message"""
    return f"Goodbye, {name}! Thanks for using our service!"

@mcp.resource("greeting://{name}")
def get_greeting_resource(name: str) -> str:
    """Get a greeting resource for the specified name"""
    return f"Greetings resource for {name}: Hello and welcome!"

if __name__ == "__main__":
    mcp.run(transport="stdio")